<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
  <style>
    div[class^="box"]{
      width: 200px;
      height: 200px;
      background-color: #eeeeee;
      margin-bottom: 50px;
      position: relative;
    }
    .box-box1{
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      margin: auto;
    }
    .box-box2{
      position: absolute;
      left: 50%;
      margin-left: -100px;
    }
    .box-box3{
      position: absolute;
      left: 50%;
      transform: translate(-50%);
    }
    .box-box4{
      margin: 0 auto;
    }
  </style>
</head>
<body>
<div class="box-box1"></div>
<div class="box-box2"></div>
<div class="box-box3"></div>
<div class="box-box4"></div>
</body>
</html>